<!-- 分析任务配置标签页 -->
<div class="space-y-6">
    <div class="flex justify-between items-center">
        <div>
            <h2 class="text-xl font-semibold text-slate-800">分析任务配置</h2>
            <p class="text-slate-600 mt-1">配置和管理AI分析任务的运行参数</p>
        </div>
        <div class="flex space-x-3">
            <button onclick="configManager.refreshConfigs()"
                    class="px-4 py-2 border border-slate-300 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors">
                <i class="fas fa-refresh mr-2"></i>刷新
            </button>
        </div>
    </div>

    <!-- 配置类型标签 -->
    <div class="bg-white rounded-xl shadow-sm border border-slate-200">
        <div class="flex flex-wrap border-b border-slate-200">
            <button class="config-tab active px-6 py-4 font-medium text-indigo-600 border-b-2 border-indigo-600" 
                    data-config-type="RegionalAnalysis" onclick="configManager.switchTab('RegionalAnalysis')">
                <i class="fas fa-map-marked-alt mr-2"></i>区域分析
            </button>
            <button class="config-tab px-6 py-4 font-medium text-slate-600 hover:text-slate-800" 
                    data-config-type="ComplaintTypeAnalysis" onclick="configManager.switchTab('ComplaintTypeAnalysis')">
                <i class="fas fa-tags mr-2"></i>信访类型分析
            </button>
            <button class="config-tab px-6 py-4 font-medium text-slate-600 hover:text-slate-800" 
                    data-config-type="SentimentAnalysis" onclick="configManager.switchTab('SentimentAnalysis')">
                <i class="fas fa-heart mr-2"></i>情感分析
            </button>
            <button class="config-tab px-6 py-4 font-medium text-slate-600 hover:text-slate-800" 
                    data-config-type="ComplianceAnalysis" onclick="configManager.switchTab('ComplianceAnalysis')">
                <i class="fas fa-clipboard-check mr-2"></i>规范性分析
            </button>
            <button class="config-tab px-6 py-4 font-medium text-slate-600 hover:text-slate-800" 
                    data-config-type="DuplicateAnalysis" onclick="configManager.switchTab('DuplicateAnalysis')">
                <i class="fas fa-copy mr-2"></i>重复信访分析
            </button>
        </div>

        <!-- 配置内容区域 -->
        <div class="p-6">
            <!-- 区域分析配置 -->
            <div id="RegionalAnalysisConfig" class="config-content">
                <form id="regionalAnalysisForm" onsubmit="event.preventDefault(); event.stopPropagation(); configManager.saveConfig('RegionalAnalysis', event)">
                    <div class="space-y-6">
                        <!-- 分析级别 -->
                        <div>
                            <label class="block text-sm font-medium text-slate-700 mb-3">
                                区域分析级别 <span class="text-red-500">*</span>
                                <span class="text-slate-500 text-xs ml-2">(可多选)</span>
                            </label>
                            <div class="grid grid-cols-3 gap-4">
                                <label class="flex items-center p-4 border border-slate-200 rounded-lg cursor-pointer hover:bg-slate-50">
                                    <input type="checkbox" name="analysis_levels" value="地市" class="w-4 h-4 text-indigo-600 border-slate-300 rounded focus:ring-indigo-500">
                                    <span class="ml-3 text-sm font-medium text-slate-700">地市</span>
                                </label>
                                <label class="flex items-center p-4 border border-slate-200 rounded-lg cursor-pointer hover:bg-slate-50">
                                    <input type="checkbox" name="analysis_levels" value="区县" class="w-4 h-4 text-indigo-600 border-slate-300 rounded focus:ring-indigo-500">
                                    <span class="ml-3 text-sm font-medium text-slate-700">区县</span>
                                </label>
                                <label class="flex items-center p-4 border border-slate-200 rounded-lg cursor-pointer hover:bg-slate-50">
                                    <input type="checkbox" name="analysis_levels" value="街道" class="w-4 h-4 text-indigo-600 border-slate-300 rounded focus:ring-indigo-500">
                                    <span class="ml-3 text-sm font-medium text-slate-700">街道</span>
                                </label>
                            </div>
                        </div>

                        <!-- 行政区划代码和经纬度分析 -->
                        <div>
                            <label class="block text-sm font-medium text-slate-700 mb-2">
                                数据范围设置
                            </label>
                            <div class="flex gap-4">
                                <div class="flex-1">
                                    <label class="block text-sm font-medium text-slate-700 mb-2">
                                        行政区划代码
                                        <span class="text-slate-500 text-xs ml-2">(行政区划代码前缀)</span>
                                    </label>
                                    <input type="text" id="region_codes" name="region_codes"
                                           placeholder="例如：110000 (北京市)"
                                           class="w-full px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
                                    <p class="text-sm text-slate-500 mt-1">请输入行政区划代码前缀，用于限定分析数据的地理范围</p>
                                </div>
                                <div class="flex-1">
                                    <label class="block text-sm font-medium text-slate-700 mb-2">
                                        经纬度分析
                                    </label>
                                    <div class="flex items-center space-x-3 mt-3">
                                        <label class="relative inline-flex items-center cursor-pointer">
                                            <input type="checkbox" id="enable_coordinate_analysis" name="enable_coordinate_analysis"
                                                   class="sr-only peer">
                                            <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-indigo-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-indigo-600"></div>
                                            <span class="ml-3 text-sm font-medium text-slate-700">启用经纬度分析</span>
                                        </label>
                                    </div>
                                    <p class="text-sm text-slate-500 mt-1">启用后将在分析中提取和利用经纬度坐标信息</p>
                                </div>
                            </div>
                        </div>

                        <!-- 提示词 -->
                        <div>
                            <label class="block text-sm font-medium text-slate-700 mb-2">
                                分析提示词 <span class="text-red-500">*</span>
                            </label>
                            <textarea id="regional_prompt" name="prompt" rows="6" required
                                      placeholder="请输入用于区域分析的大模型提示词..."
                                      class="w-full px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea>
                            <div class="flex justify-between items-center mt-2">
                                <p class="text-sm text-slate-500">提示词将用于指导大模型进行区域分析</p>
                                <button type="button" onclick="configManager.loadTemplate('RegionalAnalysis')" 
                                        class="text-sm text-indigo-600 hover:text-indigo-800">
                                    <i class="fas fa-magic mr-1"></i>加载模板
                                </button>
                            </div>
                        </div>

                        <!-- 提交按钮 -->
                        <div class="flex justify-end space-x-3 pt-4 border-t border-slate-200">
                            <button type="button" onclick="configManager.resetConfig('RegionalAnalysis')" 
                                    class="px-6 py-2 border border-slate-300 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors">
                                <i class="fas fa-undo mr-2"></i>重置
                            </button>
                            <button type="submit" 
                                    class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
                                <i class="fas fa-save mr-2"></i>保存配置
                            </button>
                        </div>
                    </div>
                </form>
            </div>

            <!-- 信访类型分析配置 -->
            <div id="ComplaintTypeAnalysisConfig" class="config-content hidden">
                <form id="complaintTypeAnalysisForm" onsubmit="event.preventDefault(); event.stopPropagation(); configManager.saveConfig('ComplaintTypeAnalysis', event)">
                    <div class="space-y-6">
                        <!-- 提示词 -->
                        <div>
                            <label class="block text-sm font-medium text-slate-700 mb-2">
                                分析提示词 <span class="text-red-500">*</span>
                            </label>
                            <textarea id="complaint_type_prompt" name="prompt" rows="8" required
                                      placeholder="请输入用于信访类型分析的大模型提示词..."
                                      class="w-full px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea>
                            <div class="flex justify-between items-center mt-2">
                                <p class="text-sm text-slate-500">提示词将用于指导大模型进行信访类型分类分析</p>
                                <button type="button" onclick="configManager.loadTemplate('ComplaintTypeAnalysis')" 
                                        class="text-sm text-indigo-600 hover:text-indigo-800">
                                    <i class="fas fa-magic mr-1"></i>加载模板
                                </button>
                            </div>
                        </div>

                        <!-- 提交按钮 -->
                        <div class="flex justify-end space-x-3 pt-4 border-t border-slate-200">
                            <button type="button" onclick="configManager.resetConfig('ComplaintTypeAnalysis')" 
                                    class="px-6 py-2 border border-slate-300 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors">
                                <i class="fas fa-undo mr-2"></i>重置
                            </button>
                            <button type="submit" 
                                    class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
                                <i class="fas fa-save mr-2"></i>保存配置
                            </button>
                        </div>
                    </div>
                </form>
            </div>

            <!-- 情感分析配置 -->
            <div id="SentimentAnalysisConfig" class="config-content hidden">
                <form id="sentimentAnalysisForm" onsubmit="event.preventDefault(); event.stopPropagation(); configManager.saveConfig('SentimentAnalysis', event)">
                    <div class="space-y-6">
                        <!-- 提示词 -->
                        <div>
                            <label class="block text-sm font-medium text-slate-700 mb-2">
                                分析提示词 <span class="text-red-500">*</span>
                            </label>
                            <textarea id="sentiment_prompt" name="prompt" rows="8" required
                                      placeholder="请输入用于情感分析的大模型提示词..."
                                      class="w-full px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea>
                            <div class="flex justify-between items-center mt-2">
                                <p class="text-sm text-slate-500">提示词将用于指导大模型进行情感倾向分析</p>
                                <button type="button" onclick="configManager.loadTemplate('SentimentAnalysis')" 
                                        class="text-sm text-indigo-600 hover:text-indigo-800">
                                    <i class="fas fa-magic mr-1"></i>加载模板
                                </button>
                            </div>
                        </div>

                        <!-- 提交按钮 -->
                        <div class="flex justify-end space-x-3 pt-4 border-t border-slate-200">
                            <button type="button" onclick="configManager.resetConfig('SentimentAnalysis')" 
                                    class="px-6 py-2 border border-slate-300 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors">
                                <i class="fas fa-undo mr-2"></i>重置
                            </button>
                            <button type="submit" 
                                    class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
                                <i class="fas fa-save mr-2"></i>保存配置
                            </button>
                        </div>
                    </div>
                </form>
            </div>

            <!-- 规范性分析配置 -->
            <div id="ComplianceAnalysisConfig" class="config-content hidden">
                <form id="complianceAnalysisForm" onsubmit="event.preventDefault(); event.stopPropagation(); configManager.saveConfig('ComplianceAnalysis', event)">
                    <div class="space-y-6">
                        <!-- 提示词 -->
                        <div>
                            <label class="block text-sm font-medium text-slate-700 mb-2">
                                分析提示词 <span class="text-red-500">*</span>
                            </label>
                            <textarea id="compliance_prompt" name="prompt" rows="8" required
                                      placeholder="请输入用于规范性分析的大模型提示词..."
                                      class="w-full px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea>
                            <div class="flex justify-between items-center mt-2">
                                <p class="text-sm text-slate-500">提示词将用于指导大模型进行答复规范性评估</p>
                                <button type="button" onclick="configManager.loadTemplate('ComplianceAnalysis')" 
                                        class="text-sm text-indigo-600 hover:text-indigo-800">
                                    <i class="fas fa-magic mr-1"></i>加载模板
                                </button>
                            </div>
                        </div>

                        <!-- 提交按钮 -->
                        <div class="flex justify-end space-x-3 pt-4 border-t border-slate-200">
                            <button type="button" onclick="configManager.resetConfig('ComplianceAnalysis')" 
                                    class="px-6 py-2 border border-slate-300 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors">
                                <i class="fas fa-undo mr-2"></i>重置
                            </button>
                            <button type="submit" 
                                    class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
                                <i class="fas fa-save mr-2"></i>保存配置
                            </button>
                        </div>
                    </div>
                </form>
            </div>

            <!-- 重复信访分析配置 -->
            <div id="DuplicateAnalysisConfig" class="config-content hidden">
                <form id="duplicateAnalysisForm" onsubmit="event.preventDefault(); event.stopPropagation(); configManager.saveConfig('DuplicateAnalysis', event)">
                    <div class="space-y-6">
                        <!-- 过滤词条 -->
                        <div>
                            <label class="block text-sm font-medium text-slate-700 mb-2">
                                过滤词条 <span class="text-red-500">*</span>
                                <span class="text-slate-500 text-xs ml-2">(每行一个，最多10个)</span>
                            </label>
                            <textarea id="filter_words" name="filter_words" rows="3" required
                                      placeholder="重复&#10;再次&#10;又&#10;重新"
                                      class="w-full px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea>
                            <p class="text-sm text-slate-500 mt-1">用于识别重复信访内容的关键词，每行一个词条</p>
                        </div>

                        <!-- 提示词 -->
                        <div>
                            <label class="block text-sm font-medium text-slate-700 mb-2">
                                分析提示词 <span class="text-red-500">*</span>
                            </label>
                            <textarea id="duplicate_prompt" name="prompt" rows="8" required
                                      placeholder="请输入用于重复信访分析的大模型提示词..."
                                      class="w-full px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea>
                            <div class="flex justify-between items-center mt-2">
                                <p class="text-sm text-slate-500">提示词将用于指导大模型进行重复内容识别和分析</p>
                                <button type="button" onclick="configManager.loadTemplate('DuplicateAnalysis')" 
                                        class="text-sm text-indigo-600 hover:text-indigo-800">
                                    <i class="fas fa-magic mr-1"></i>加载模板
                                </button>
                            </div>
                        </div>

                        <!-- 提交按钮 -->
                        <div class="flex justify-end space-x-3 pt-4 border-t border-slate-200">
                            <button type="button" onclick="configManager.resetConfig('DuplicateAnalysis')" 
                                    class="px-6 py-2 border border-slate-300 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors">
                                <i class="fas fa-undo mr-2"></i>重置
                            </button>
                            <button type="submit" 
                                    class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
                                <i class="fas fa-save mr-2"></i>保存配置
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

    </div>